package com.example.demo.dao1;

import com.example.demo.entity.Stus;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StuDao {
    @Select({"select * from sss where id=#(no)"})
    Stus getStu(int no);

    @Insert({"insert into stu(name,sex,classId) Values (#{name},#{sex},#{classId})"})
    int insert(String name, String sex, int classId);

    @Select({"select * from sss where classId=#{id}"})
    List<Stus> getList(int id);

    @Update({"update stu set name=#{newName} where id=#{id}"})
    int update(String newName, int id);

    @Delete({"delete from stu where id=#{id}"})
    int delete(Integer id);

    @Select({"select * from stu "})
    List<Stus> getAll();
}
